package com.jt.assistant.adapter

import android.annotation.SuppressLint
import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.jt.assistant.R
import com.jt.assistant.bean.DiffSkuListBean

class DiffAdapter(mData: MutableList<DiffSkuListBean>) :
    BaseQuickAdapter<DiffSkuListBean, BaseViewHolder>(
        R.layout.item_diff, mData
    ) {

    @SuppressLint("SetTextI18n")
    override fun convert(holder: BaseViewHolder, item: DiffSkuListBean) {
        val sku = holder.getView<TextView>(R.id.tv_sku)
        val num = holder.getView<TextView>(R.id.tv_num)

        sku.text = item.sku
        when (item.type) {
            "1" -> {
                num.text = "少货 " + item.num
            }
            "2" -> {
                num.text = "多货 " + item.num
            }
            else -> {
                num.text = "破损 " + item.num
            }
        }
    }


}